<?php
include("startsess.php");
if($log){
?>

<?php
if(isset($_POST['search_doc'])) $_SESSION['query'] = $_POST;
$query = $_SESSION['query'];

?>
<a href="report_nokasean.php" target="_blank" >ทำรายงานหนังสือรับแบบไม่มีรายงานการเกษียน</a><br />
<a href="report.php" target="_blank" >ทำรายงานหนังสือรับแบบรายงานการเกษียนเฉพาะหน่วยงาน</a><br />
<a href="report2.php" target="_blank" >ทำรายงานหนังสือรับแบบรายงานการเกษียนทั้งหมด</a><br /><br />

<?php

$condition = " where ";
$condition = addSecretCon($condition,$query);
$condition = addRapidCon($condition,$query);
$condition = addDoctypeCon($condition,$query);
//$condition = addTxtCon($condition,$query['recieve_no'],"recieve_no");
$condition = addRecNo($condition,$query['recieve_no']);
$condition = addTxtCon($condition,$query['doc_no'],"doc_no");
$condition = addTxtCon($condition,$query['headline'],"headline");
$condition = addTxtCon($condition,$query['sender'],"sender");
$condition = addTxtCon($condition,$query['commentdoc'],"comment");
$condition = addDateCon($condition,$query['recieve1'],$query['recieve2'],"recieve_date");
$condition = addDateCon($condition,$query['doc1'],$query['doc2'],"doc_date");
$condition = addDepartSend($condition,$query['depart'],$query['depart_send']);

if($condition==" where ") $condition = "";
if($query['pname']!=0 && isset($query['pname'])) shDocSearchKsean($condition,$query['pname'],$query['ksean_op'],$query['depart_id_recieve']);
else shDocSearch($condition);

?>

<?php
}
include("ft.php");
?>
